package com.sjtu.web;

/**
 * nerine
 * 1/28/2020
 */
public abstract class BaseRest {
    protected Result success() {
        return new Result(Result.ResultCode.SUCCESS, "success", null);
    }
    protected <T> Result<T> success(T data) {
        return new Result(Result.ResultCode.SUCCESS, "success", data);
    }

    protected Result fail() {
        return new Result(Result.ResultCode.FAIL, "fail", null);
    }

    protected Result paramCheckFail(String msg) {
        return new Result(Result.ResultCode.ILLEGAL, msg == null ? "illegal param" : msg, null);
    }
}
